<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title></title>
	<link rel="stylesheet" type="text/css" href="./style.css" />
	<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
	<script src="https://unpkg.com/axios/dist/axios.min.js"></script>

</head>

<body>
	<div id="app">
		<ul>
			<li class="tital">
				我的信息
			</li>
			<li>
				<div id="myMsg">
					<div class="imgBox">
						<img :src="img" class="img">
					</div>

					<div id="" class="block">
						<div class="name">
							{{name}}
						</div>
						<br>
						<div class="phone">
							手机号：{{phone}}
						</div>

					</div>

				</div>
			</li>
			<li class="tital">
				添加绑定
			</li>
			<li>

				<div id="addCenect">
					<div id="" class="right" v-for="(child,index) in children" :key="index">
						<el-button type="primary" @click="childlist(child)" :id="child.id">{{child.zhenUsername}}
						</el-button>
					</div>
					<el-button @click="addStudent()"><i class="el-icon-plus"></i></el-button>
				</div>
			</li>
		</ul>

	</div>
</body>
<script src="../pub/vue.min.js"></script>
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script type="text/javascript">
	var app = new Vue({
		el: '#app',
		data() {
			return {
				http: '' + localStorage.getItem("http"),
				img: '' + localStorage.getItem("headimgurl"),
				name: '' + localStorage.getItem("nickname"),
				phone: '' + localStorage.getItem("phonef"),
				pageNum: "",
				pageSize: "",
				StudentUserId: "",
				children: [],
			}
		},
		created() {

			this.getChildren();

		},
		methods: {
			addStudent() {
				location.href = "../informationCollection/informationCollection.html";
			},
			getChildren() {

				axios.get(this.http + '/queryStudentInfoByParentId?parentId=' + localStorage.getItem("userId"))
					.then(response => {
						this.children = response.data.data
					})
					.catch(function (error) {

					});
			},
			childlist(id) { //获取当前孩子内容

				window.location.href = "../evaluation/evaluation.html?id=" + id.id;
			}
		}
	})
</script>

</html>